<template>
  <div class="tool">
    <div class="file" @click="openList()" v-if="componentInfoTool.fileList">
      <span>
        文件序列
        <span v-show="currentIndex || currentIndex == 0">：{{currentIndex 1}}</span>
      </span>
    </div>
    <div class="progress" v-if="componentInfoTool.progress">标注进度 {{finishNum}}/{{all}}</div>
    <div class="allFile" v-if="componentInfoTool.dataType">
      <span v-if="fileType==1">全部数据</span>
      <span v-if="fileType==2">好数据</span>
      <span v-if="fileType==3">坏数据</span>
      <span v-if="fileType==4">未标注</span>
      <ul class="fileType">
        <li @click="chooseType(1)">全部数据</li>
        <li @click="chooseType(2)">
          好数据
          <span v-if="dataNum">({{dataNum.correct}})</span>
        </li>
        <li @click="chooseType(3)">
          坏数据
          <span v-if="dataNum">({{dataNum.bad}})</span>
        </li>
        <li @click="chooseType(4)">
          未标注
          <span v-if="dataNum">({{dataNum.unfinish}})</span>
        </li>
      </ul>
    </div>
    <div class="prevData" @click="pre" v-if="componentInfoTool.pre">上一条</div>
    <div class="nextData" @click="next" v-if="componentInfoTool.next">下一条</div>
    <div
      class="badData"
      v-show="!currentIsBad"
      @click="markBad"
      v-if="componentInfoTool.markBad"
    >标为坏数据</div>
    <div class="badData" :class="{\r\:currentIsBad}" v-show="currentIsBad" @click="markBad">标为好数据</div>
    <div class="slide" @click="changeShow" :class='{showHead?\"go\":\"aa\"}'></div>
    <div class="line"></div>
  </div>
</template>
<script>
export default {
    name : 'Tool',
    data(){
        return {

        }
    },
    props: ['showHead','fileType','finishNum','currentIndex','dataNum','currentIsBad','all','componentInfoTool'],
    methods: {
        openList: function () {
            this.$emit("openList")
        },
        changeShow: function () {
            this.$emit("changeShow")
        },
        chooseType: function (val) {
            this.$emit("chooseType",val)
        },
        pre: function () {
            this.$emit("pre")
        },
        next: function () {
            this.$emit("next")
        },
        markBad: function () {
            this.$emit("markBad")
        }
    }
}
</script>